-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: input: added stm32 tsc peripheral support #81187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8c83663 to
4dfb233
Compare
|
I may have missed something but why is it a |
I initially put it inside the input subsys and we've discussed about this in the issue I've linked. But it did not seem right because the acqusition needs to be started manually by calling Also if the interrupts are kept disabled, the value needs to be polled, so it does not report it to the input subsys but rather user uses |
4dfb233 to
812de4a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job though I think that implementing this as a misc driver and exposing it as counter is missing the point of using the input subsystem, or any subsystem really, you may as well use an entire custom API. An application would have to be written specifically for this device to use it anyway. The point of the input subsystem is that you can write an application that takes "buttons" and make it take events from any driver that generates a button event, and touch sense devices looks very much button-y to me.
I'd suggest dropping the sample, bringing the initialization code in the driver and make it generate key events.
I can see how that gets confusing. Maybe I should drop input subsystem, because this peripheral is not exactly designed to only work as buttons but can also be used as a proximity sensor, sliders and whatnot, and usually a lot of filtrering is done over these count values, so acquiring them even every 1ms might be slow. I designed this driver thinking that another library would run on this to finally produce a click or any other input event. Again maybe dropping it from this driver would be better, though I dont know where to put the captured data from the ISR |
You could keep this as a misc device with its own device specific API and then instead of the sample make an input driver based on top of the misc one that implements buttons (or sliders, or anything). Then one could use it for buttons with the input driver with no extra code, just dt configuration, or use it directly for whatever. You could even set a couple threshold and make it produce two input events, one for proximity and one for click, or more implementations, like one that implement a slider and produces absolute events. Would that make sense? I think it'd be cool, leave all options open but solves common use cases with in-tree code. |
Makes sense, so then I would do something like |
812de4a to
018db96
Compare
d6bed0b to
154a729
Compare
|
@gmarull can you take another look? Erwan is out if you approve this I think we can merge it before RC1 |
154a729 to
6341ce9
Compare
6341ce9 to
145b0e0
Compare
Added tsc pripheral bindings Signed-off-by: Arif Balik <[email protected]>
update stm32u0 and stm32u083c_dk for TSC peripheral Signed-off-by: Arif Balik <[email protected]>
input_tsc_keys to detect key press releases using STM32 TSC Signed-off-by: Arif Balik <[email protected]>
integration tests for stm32 tsc Signed-off-by: Arif Balik <[email protected]>
145b0e0 to
5ea7263
Compare
This is an implementation for STM32 TSC (touch sensing controller) driver. The details are discussed in
I've also added tests and a sample application for this and put it inside the same branch but this makes the PR rather large so I'm nor sure if I should split it in separate PRs, to make everything easier, I've separated them into different commits.
Closes #79126
Note: I've written this driver for my blog post. Maybe it can help the review process;
https://arifbalik.github.io/self-monorepo/zephyr-device-driver/